<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>详细信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/css/public.css"  media="all">
		<link href="__PUBLIC__/css/admin.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="__PUBLIC__/css/looklayer.css"  media="all">
    <style>
        .layui-layer-setwin .layui-layer-close2  {
            position: relative !important;
            right: 0!important;
            top:0 !important;
        }

    </style>
</head>
<body>
<div class="layui-conter">
    <div class="layui-col-md12">
        <div class="navigation">
            <span>销售></span><span>客户列表></span><span>详细信息</span>
        </div>
        <div>
            <div style="float: left;width: 32%">
                <div class="white-conter">
                    <div class="title-blue">学生个人基本信息</div>
                    <div>
						<div class="layui-col-md12 textSet">
							<div class="layui-col-md5">学生编号</div>
							<div class="layui-col-md7">{$sc_student.student_id}</div>
						</div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">学生姓名</div>
                            <div class="layui-col-md7">{$sc_student.name}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">英文名</div>
                            <div class="layui-col-md7">{$sc_student.names}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">学生性别</div>
                            <div class="layui-col-md7">{$sc_student.sex}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">学生生日</div>
                            <div class="layui-col-md7">{$sc_student.birth_date}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">咨询顾问</div>
                            <div class="layui-col-md7">{$sc_student.xs_name}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">家长手机</div>
                            <div class="layui-col-md7">{$sc_student.phone}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">其他手机</div>
                            <div class="layui-col-md7">{$sc_student.other_phone}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">咨询时间</div>
                            <div class="layui-col-md7">{$sc_student.news_time}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">咨询渠道</div>
                            <div class="layui-col-md7">{$sc_student.am_name}</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">下次回访时间</div>
                            <div class="layui-col-md7">2018-05-16</div>
                        </div>
                        <div class="layui-col-md12 textSet">
                            <div class="layui-col-md5">意向度</div>
                            <div class="layui-col-md7">{$sc_student.state_name}</div>
                        </div>
                    </div>
                </div>

            </div>
            <div  style="float: right;width: 65%">
                <div class="white-conter">
                    <div class="title-blue">销售跟进状态<if condition="$sc_student['dt_id'] eq 0"> | <button data-method="offset" data-type="auto" data-id="{$sc_student.id}" class="img-but edit-img"></button></if></div>
                    <div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1">
                        <div class="layui-table-box" style="margin: 20px 50px 0 0">
                            <div class="layui-table-body layui-table-main" style="padding-bottom: 40px">
                                <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                                    <thead>
                                    <tr>
                                        <th data-field="date">
                                            <div class="layui-table-cell laytable-cell-1-date" align="center">
                                                <span>跟进日期</span>
                                                </span>
                                            </div>
                                        </th>
                                        <th data-field="consultant">
                                            <div class="layui-table-cell laytable-cell-1-consultant" align="center">
                                                <span>跟进顾问</span>
                                            </div>
                                        </th>
                                        <th data-field="way">
                                            <div class="layui-table-cell laytable-cell-1-way" align="center">
                                                <span>跟进方式</span>
                                            </div>
                                        </th>
                                        <th data-field="content">
                                            <div class="layui-table-cell laytable-cell-1-content" align="center">
                                                <span>跟进内容</span>
                                            </div>
                                        </th>
                                        <th data-field="operation">
                                            <div class="layui-table-cell laytable-cell-1-operation" align="center">
                                                <span>试听状态</span>
                                            </div>
                                        </th>
                                        <th data-field="operation">
                                            <div class="layui-table-cell laytable-cell-2-operation" align="center">
                                                <span>操作 </span>
                                            </div>
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
																	<foreach name="record_data" item="r">
                                    <tr data-index="1" class="">
                                        <td data-field="date" align="center">
                                            <div class="layui-table-cell laytable-cell-1-date">{$r.start_time}</div>
                                        </td>
                                        <td data-field="consultant" align="center">
                                            <div class="layui-table-cell laytable-cell-1-consultant">{$r.xs_name} </div>
                                        </td>
                                        <td data-field="way" align="center">
                                            <div class="layui-table-cell laytable-cell-1-way">{$r.cmmode} </div>
                                        </td>
                                        <td data-field="content" align="center">
                                            <div class="layui-table-cell laytable-cell-1-content">
                                                {$r.content}
                                            </div>
                                        </td>
                                        <td data-field="operation" align="center">
                                            <div class="layui-table-cell laytable-cell-1-operation" >{$sc_student.classname}  </div>
                                        </td>
                                        <td data-field="operation" align="center">
                                            <div class="layui-table-cell laytable-cell-2-operation">
                                                <button data-method="offset" data-type="auto" data-id="{$r.id}" class="img-but look-img"></button>
                                            </div>
                                        </td>
                                    </tr>
																	</foreach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="layui-table-page">
                            <div id="layui-table-page1">
                                <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1">
                                    <a href="javascript:;" class="layui-laypage-prev layui-disabled" data-page="0">
                                        <i class="layui-icon"></i></a>
                                  <a href="javascript:;" class="layui-laypage-next" data-page="2">
                                        <i class="layui-icon"></i></a>
                                </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </div>

</div>






<script src="__PUBLIC__/js/layui.all.js" charset="utf-8"></script>
<script src="__PUBLIC__/js/jquery.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('element', function(){
        var $ = layui.jquery
            ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        //触发事件
        var active = {
            tabChange: function(){
                //切换到指定Tab项
                element.tabChange('demo', '22'); //切换到：用户管理
            }
        };


    });
</script>
<script>
    layui.use( ['form','layer','laydate','element'], function(){
        var  form = layui.form
            , $ = layui.jquery
            ,layer = layui.layer
            ,element = layui.element
            , laydate = layui.laydate;
			
        //触发事件
				setTimeout(function() {
					element.init()
					form.render();
				});
				form.render();
        var active = {
            offset: function(othis){
                var type = othis.data('type')
                    ,text = othis.text();
                layer.open({
                    type: 1,
                    title: false,
                    area: ['790px', '440px'],
                    shadeClose: true,
                    skin: 'layer-look',
                    content:'<form class="layui-form layer_notice"  action="" lay-filter="test1" >' +
                    '</form>'
                });

            }
        };
        $('.edit-img').on('click', function(){
            var othis = $(this), method = othis.data('method'),id = othis.data('id');
            active[method] ? active[method].call(this, othis) : '';
						$.post("{:U('Customer/auditions')}",{id:id},function(data){
							console.log(data);
									var html= '<form class="layui-form layer_notice"  action="{:U("Customer/record")}" method="post" lay-filter="test1" >' +
													'<input type="hidden" value="'+id+'" name="sid">'+
								'<div class="look-conter">' +
											'        <div class="look-title">销售跟进状态</div>' +
											'    </div>' +
											'    <div class="look-list layui-col-md10" >' +
											'        <div class="look-tip layui-col-md3"  >跟进方式</div>' +
											'        <input type="text" name="cmmode" value="" class="layui-input" style="width:70%">' +
											'    </div>' +
											'    <div class="look-list layui-col-md10" >' +
											'        <div class="look-tip layui-col-md3" >下次跟进时间</div>' +
											'        <div class="look-state layui-col-md8">' +
											'            <input type="text" name="next_time" id="track" lay-verify="date" placeholder="请选择" autocomplete="off" class="layui-input">' +
											'        </div>' +
											'    </div>' +
										'<div class="look-list layui-col-md10"><div class="look-tip layui-col-md3">添加试听课</div>' +
										'<div class="look-state layui-col-md3">';
										if(data['tate'] == 0){
											html += '<select name="auditions_id" id="auditions_id" style="display: block"><option value="">请选择试听课</option>' ;
											for(var i=0;i<data['class'].length;i++){
														html += '<option value="'+data['class'][i].id+'">'+data['class'][i].classname+'</option>' ;
											}
											html += '</select>' ;
										}else if(data['tate'] == 1){
														html += '<span>已试听:'+data['class'].classname+'</span>';
										}
										html += '</div>' +
										'</div>' +
											'    <div class="look-list layui-col-md10" >' +
											'        <div class="look-tip layui-col-md3">跟进内容</div>' +
											'        <div class="look-state layui-col-md9"> <textarea placeholder="请输入内容" class="layui-textarea" name="content"></textarea></div>' +
											'    </div>'+
										'</div>  <div class="layui-col-md12">\n' +
										'<div class="button-block">\n' +
										'<input class="layui-btn layui-btn-xs layui-btn-normal" lay-submit="" value="保存" type="submit">' +
										'</div>\n' +
										'</div>' +
										'</form>';
									$('.layer_notice').append(html);
									laydate.render({
										elem: '#track'
									});
						})
        });
		$('.look-img').on('click', function(){
			var othis = $(this), method = othis.data('method'),id = othis.data('id');
			active[method] ? active[method].call(this, othis) : '';
			$.post("{:U('Customer/look_show')}",{id:id},function (data){
				console.log(data);
				var html= '<form class="layui-form layer_notice"  action="" lay-filter="test1" >' +
						'<div class="look-conter">' +
					'        <div class="look-title">销售跟进状态</div>' +
					'    </div>' +
					'    <div class="look-list layui-col-md10" >' +
					'        <div class="look-tip layui-col-md3"  >跟进方式</div>'+data.cmmode+'</div>' +
					'    <div class="look-list layui-col-md10" >' +
					'        <div class="look-tip layui-col-md3" >下次跟进时间</div>' +
					'        <div class="look-state layui-col-md8">'+data.next_time+'</div>' +
					'    </div>' +
					'    <div class="look-list layui-col-md10" >' +
					'        <div class="look-tip layui-col-md3" >试听状态</div>' +
					'        <div class="look-state layui-col-md9" >'+data.classname+'</div>' +
					'    </div>' +
					'    <div class="look-list layui-col-md10" >' +
					'        <div class="look-tip layui-col-md3">跟进内容</div>' +
					'        <div class="look-state layui-col-md9">'+data.content+'</div>' +
					'    </div>'+
					'    <div class="look-list layui-col-md10" >' +
					'        <div class="look-tip layui-col-md3">跟进销售</div>' +
					'        <div class="look-state layui-col-md9">'+data.xs_name+'</div>' +
					'    </div>'+
					'</form>';
				$('.layer_notice').append(html);
			})
		});
    });
</script>
</body>
</html>
